#!/bin/sh


APPNAME="read_watts.pl"

# if the app name _IS_ found in process list, exit
ps xc|fgrep "${APPNAME}" >/dev/null && exit 0

 # if the app isn't found, open it
echo ${APPNAME} "Not found, Loading it now"
cd /var/www/energy/collector
./${APPNAME} 2>&1 | logger -t watts &

exit 0
